﻿
    
    
    <Window x:Class="CSSAdriverapp.DriverMain"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="CSSA Driver Application" Height="560" Width="750" xmlns:my="clr-namespace:CSSAdriverapp" Icon="/CSSA%20Driver%20App;component/lorry_green_256.ico">
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="287*" />
        </Grid.RowDefinitions>
        <Menu Height="23" HorizontalAlignment="Stretch" Name="menu1" VerticalAlignment="Top" Width="Auto">
            <MenuItem Header="File" >
                <MenuItem Header="Update Events" Click="Update_Events_Click" Background="#FFEBF51A" >
                    <MenuItem.Icon>
                        <Image Source="icons\down_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Export To Excel" IsEnabled="True" Click="Export_Excel_Click" Name="ExportExcel" Visibility="Visible">
                    <MenuItem.Icon>
                        <Image Source="icons\export_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Exit" Click="Close_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\stop_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                </MenuItem>
            <MenuItem Header="Van Scheduling">
                <MenuItem Header="Schedule One Time Transportation" Click="Schedule_Transportation_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\execute_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>

            </MenuItem>
                <MenuItem Header="Drivers" IsEnabled="True">
                <MenuItem Header="Add Driver" Click="Add_Driver_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\add_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>                      
                <MenuItem Header="View/Edit Drivers" Click="Edit_Driver_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\edit__16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Assign Driver" Click="Assign_Driver_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\save as_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Driver Info" Click="Driver_Info_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\info_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>                 
                <MenuItem Header="Available Drivers" Click="Available_Drivers" >
                    <MenuItem.Icon>
                        <Image Source="icons\user_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Clear Driver Schedules" Click="Activity_ClearDriverSchedules_Click" Background="#FFF70B0B">
                    <MenuItem.Icon>
                        <Image Source="icons\trash_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="Vehicles" >
                <MenuItem Header="Add Vehicle" Click="Add_Vehicle_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\add_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="View/Edit Vehicles" Click="Edit_Vehicle_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\edit__16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Add Vehicle Type" Click="Add_Vehicle_Type_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\add_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="View/Edit Vehicle Types" Click="Edit_Vehicle_Type_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\edit__16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                
            </MenuItem>
            <MenuItem Header="Semester Tools" >
                <MenuItem Header="Generate Events" Click="Generate_Events_Click" Background="#FFF70B0B" >
                    <MenuItem.Icon>
                        <Image Source="icons\wizard_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Schedule Weekly Transportation" Click="Schedule_Weekly_Transportation_Click" Background="#FFF70B0B">
                    <MenuItem.Icon>
                        <Image Source="icons\execute_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Activity Update" Click="Activity_Update_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\options_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Activity Comments" Click="Activity_Comments_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\note_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
                
            </MenuItem>
            <MenuItem Header="Help" IsEnabled="True">
                <MenuItem Header="About CSSA Driver Application" Click="About_Click">
                    <MenuItem.Icon>
                        <Image Source="icons\help_16x16.png" />
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
        </Menu>
        <DataGrid AutoGenerateColumns="False" Grid.Row="2" HorizontalAlignment="Stretch" Name="displayDataGrid" VerticalAlignment="Stretch" ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:DriverMain, AncestorLevel=1}, Path=mainEvents}" DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:DriverMain, AncestorLevel=1}}" IsReadOnly="True" AlternatingRowBackground="#764EA6FF" GridLinesVisibility="None" HorizontalGridLinesBrush="#B941AAC3" SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
            <DataGrid.ContextMenu>
                <ContextMenu >
                    <MenuItem Header="Edit Notes" Click="Edit_Notes_Click">
                        <MenuItem.Icon>
                            <Image Source="icons\note_16x16.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Edit Vehicle" Click="Edit_EventVehicle_Click">
                        <MenuItem.Icon>
                            <Image Source="icons\execute_16x16.png" />
                        </MenuItem.Icon>
                    </MenuItem>

                </ContextMenu>
            </DataGrid.ContextMenu>
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=date.DayOfWeek}" Header="Weekday" />
                <DataGridTextColumn Binding="{Binding Path=date.Month}" Header="Month" />
                <DataGridTextColumn Binding="{Binding Path=date.Day}" Header="Day" />
                <DataGridTextColumn Binding="{Binding Path=depart, StringFormat={}{0: hh:mm tt}}" Header="Departure" />
                <DataGridTextColumn Binding="{Binding Path=returntime, StringFormat={}{0: hh:mm tt}}" Header="Arrival" />
                <DataGridTextColumn Binding="{Binding Path=driver}" Header="Driver" />
                <DataGridTextColumn Binding="{Binding Path=transportation}" Header="Vehicle" />
                <DataGridTextColumn Binding="{Binding Path=servicetimebegin, StringFormat={}{0: hh:mm tt}}" Header="Service Start" />
                <DataGridTextColumn Binding="{Binding Path=servicetimeend, StringFormat={}{0: hh:mm tt}}" Header="Service End" />
                <DataGridTextColumn Binding="{Binding Path=site}" Header="Site" />
                <DataGridTextColumn Binding="{Binding Path=numattending}" Header="# Attending" />
                <DataGridTextColumn Binding="{Binding Path=Notes}" Header="Notes" />
                <DataGridTextColumn Binding="{Binding Path=ActivityComments}" Header="Comments" />
            </DataGrid.Columns>
        </DataGrid>
        <Expander Grid.Row="1" Header="Date Selection" Height="Auto" HorizontalAlignment="Stretch" Name="calendarExpander" VerticalAlignment="Stretch" Width="Auto" IsExpanded="True" Foreground="Black" OpacityMask="{x:Null}" Background="#E2003867" FontWeight="Normal">
            <Grid>
                <Calendar Height="170" HorizontalAlignment="Left" Margin="22,5,0,0" Name="calendar" VerticalAlignment="Top" Width="180" SelectionMode="SingleRange" Padding="0" SelectedDatesChanged="calendar_SelectedDatesChanged" DisplayMode="Month" />
                <ProgressBar Height="163" HorizontalAlignment="Left" Margin="200,7,0,0" Name="progressBar" VerticalAlignment="Top" Width="12" Visibility="Hidden" Orientation="Vertical" />
                <Rectangle Height="161" HorizontalAlignment="Left" Margin="22,8,0,0" Name="rectangle" Stroke="{x:Null}" VerticalAlignment="Top" Width="180" Fill="#CED0D0D0" Visibility="Hidden" />
            </Grid>
        </Expander>
    </Grid>
</Window>
